cmake_minimum_required(VERSION 2.8)
project(IEPESensor)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
aux_source_directory(. code)
set(cmd cmd/command.h cmd/protocol.h cmd/wifi_iepe.h )
find_package(Qt5 COMPONENTS REQUIRED Core Gui Widgets Network PATHS d:/tools/qt/5.9.2/msvc2017_64/lib/cmake/qt5)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
include_directories(
    ./cmd
    /usr/include/x86_64-linux-gnu/qt5/QtWidgets
    /usr/include/x86_64-linux-gnu/qt5/QtCharts
)
set(QT_UIC_EXECUTABLE /usr/lib/x86_64-linux-gnu/qt5/bin/uic)
set(UI_FILES mainwindow.ui QtGuiCurveWgt.ui QtGuiValueShowWgt.ui)
qt_wrap_ui(UI_HEADERS ${UI_FILES})

if(MSVC) 
    add_compile_options(/EHa)
endif()
add_executable(IEPESensor ${code} ${cmd} ${UI_HEADERS})
target_link_libraries(IEPESensor Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network)